# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'soal.ui'
#
# Created: Tue May 03 13:02:37 2011
#      by        : PyQt4 UI code generator 4.7 
#      edited by : licface <licface@yahoo.com>
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
import md5
import os
import sys
import library
import error
import view
import time
import model
import traceback
import v_soal_t

class show_soal(v_soal_t.vsoal):
    def __init__(self, parent=None):
        v_soal_t.vsoal.__init__(self)

class MainWindows(QtGui.QMainWindow):
    closed = QtCore.pyqtSignal()
    
    def __init__(self, parent=None):
        super(MainWindows, self).__init__(parent)
        self.parent = parent
        #QtGui.QMainWindow.__init__(self)

    #def setupUi(self, MainWindow):

        if os.getcwd() != os.path.split(sys.argv[0])[0]:
            if "view" in os.path.split(sys.argv[0])[0]:
                os.chdir("..\\")
                self.mypath = os.path.split(sys.argv[0])[0] + "/images/"
            else:
                if "system" in os.path.split(sys.argv[0])[0]:
                    self.mypath = os.path.split(sys.argv[0])[0] + "/images/"
                else:
                    self.mypath = os.path.split(sys.argv[0])[0] + "/system/images/"
        else:
            if "system" in os.getcwd():
                if "view" in os.getcwd():
                    os.chdir("..\\")
                    self.mypath = os.path.split(sys.argv[0])[0] + '/images/' 
                else:
                    self.mypath = os.path.split(sys.argv[0])[0] + '/images/' 
            else:
                self.mypath = os.path.split(sys.argv[0])[0] + "/system/images/"

        self.setObjectName("MainWindow")
        self.setEnabled(True)
        self.resize(480, 624)
        self.setGeometry(300,50,480,624)
        self.setFixedSize(480, 624)
        self.setWindowTitle("Soal")
        self.setWindowFlags(QtCore.Qt.Window)

        self.centralwidget = QtGui.QWidget(self)
        self.centralwidget.setObjectName("centralwidget")

        self.l_head = QtGui.QLabel(self.centralwidget)
        self.l_head.setGeometry(QtCore.QRect(150, 20, 200, 21))
        self.l_head.setObjectName("l_head")

        self.uinfo = QtGui.QGroupBox(self.centralwidget)
        self.uinfo.setGeometry(QtCore.QRect(20, 100, 431, 400))
        self.uinfo.setObjectName("uinfo")

        self.iinfo = QtGui.QGroupBox(self.uinfo)
        self.iinfo.setGeometry(QtCore.QRect(20, 120, 391, 260))
        self.iinfo.setObjectName("iinfo")
        
        self.einfo = QtGui.QGroupBox(self.iinfo)
        self.einfo.setGeometry(QtCore.QRect(10, 70, 370, 180))
        self.einfo.setObjectName("einfo")
        
        self.progressbar = QtGui.QProgressBar(self)
        self.progressbar.setGeometry(20,530,430,20)
        self.progressbar.setValue(0)
        self.progressbar.setTextVisible(False)

        self.l_username = QtGui.QLabel(self.uinfo)
        self.l_username.setGeometry(QtCore.QRect(30, 20, 101, 16))
        self.l_username.setObjectName("l_username")

        self.l_password = QtGui.QLabel(self.uinfo)
        self.l_password.setGeometry(QtCore.QRect(30, 80, 101, 16))
        self.l_password.setObjectName("l_password")

        self.j_username = QtGui.QLineEdit(self.uinfo)
        self.j_username.setGeometry(QtCore.QRect(113, 18, 251, 25))
        self.j_username.setObjectName("j_username")

        self.j_password = QtGui.QLineEdit(self.uinfo)
        self.j_password.setEchoMode(QtGui.QLineEdit.Password)
        self.j_password.setGeometry(QtCore.QRect(113, 78, 251, 25))
        self.j_password.setObjectName("j_password")

        self.l_info = QtGui.QLabel(self.iinfo)
        self.l_info.setGeometry(QtCore.QRect(70, 25, 310, 16))
        self.l_info.setObjectName("l_info")

        self.l_image_info = QtGui.QLabel(self.iinfo)
        self.l_image_info.setMinimumSize(50, 50)
        self.l_image_info.setGeometry(10, 10, 51, 51)
        self.img_info = QtGui.QImage(self.mypath + 'Info2.png')
        self.l_image_info.setPixmap(QtGui.QPixmap.fromImage(self.img_info))
        
        self.l_image_info2 = QtGui.QLabel(self.einfo)
        self.l_image_info2.setMinimumSize(50, 50)
        self.l_image_info2.setGeometry(10, 10, 51, 51)
        self.img_info2 = QtGui.QImage(self.mypath + 'Debug2.png')
        self.l_image_info2.setPixmap(QtGui.QPixmap.fromImage(self.img_info2))
        
        self.l_info2 = QtGui.QLabel(self.einfo)
        self.l_info2.setGeometry(QtCore.QRect(70, 0, 280, 100))
        self.l_info2.setObjectName("l_info2")
        self.l_info2.setWordWrap(True)

        self.login_bt = QtGui.QPushButton(self.centralwidget)
        self.login_bt.setGeometry(QtCore.QRect(360, 550, 91, 31))
        self.login_bt.setObjectName("login_bt")
        self.login_bt.connect(self.login_bt, QtCore.SIGNAL("clicked()"), self.inputdata)
        
        self.cancel_bt = QtGui.QPushButton(self.centralwidget)
        self.cancel_bt.setGeometry(QtCore.QRect(20, 550, 91, 31))
        self.cancel_bt.setObjectName("cancel_bt")
        self.cancel_bt.hide()
        #self.cancel_bt.connect(self.cancel_bt, QtCore.SIGNAL("clicked()"), self.inputdata)
        
        self.reset_bt = QtGui.QPushButton(self.centralwidget)
        self.reset_bt.setGeometry(QtCore.QRect(20, 550, 91, 31))
        self.reset_bt.setObjectName("reset_bt")
        self.reset_bt.connect(self.reset_bt, QtCore.SIGNAL("clicked()"), self.form_input_clear)

        self.widget = QtGui.QWidget(self.centralwidget)
        self.widget.setGeometry(QtCore.QRect(160, 120, 132, 41))
        self.widget.setObjectName("widget")

        self.setCentralWidget(self.centralwidget)

        self.menubar = QtGui.QMenuBar(self)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 480, 20))
        self.menubar.setLayoutDirection(QtCore.Qt.RightToLeft)
        self.menubar.setObjectName("menubar")
        self.menuAbout = QtGui.QMenu(self.menubar)
        self.menuAbout.setObjectName("menuAbout")
        self.menuHelp = QtGui.QMenu(self.menubar)
        self.menuHelp.setObjectName("menuHelp")
        self.menuSetting = QtGui.QMenu(self.menubar)
        self.menuSetting.setObjectName("menuSetting")
        self.menuFile = QtGui.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        self.setMenuBar(self.menubar)

        self.statusbar = QtGui.QStatusBar(self)
        self.statusbar.setObjectName("statusbar")
        self.setStatusBar(self.statusbar)

        self.actionAuthor = QtGui.QAction(self)
        self.actionAuthor.setObjectName("actionAuthor")
        self.actionLihat_semua_soal = QtGui.QAction(self)
        self.actionLihat_semua_soal.setObjectName("actionLihat_semua_soal")
        self.actionAbout = QtGui.QAction(self)
        self.actionAbout.setObjectName("actionAbout")
        self.actionClose = QtGui.QAction(self)
        self.actionClose.setObjectName("actionClose")
        self.actionSetting = QtGui.QAction(self)
        self.actionSetting.setObjectName("actionSetting")

        self.menuAbout.addAction(self.actionAuthor)
        self.menuSetting.addAction(self.actionSetting)
        self.menuFile.addAction(self.actionClose)
        

        self.connect(self.actionAuthor, QtCore.SIGNAL("triggered()"), self.win_error)
        self.connect(self.actionClose, QtCore.SIGNAL("triggered()"), self.quit)
        self.connect(self.actionSetting, QtCore.SIGNAL("triggered()"), self.win_conf)
        
        self.menubar.addAction(self.menuAbout.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())
        self.menubar.addAction(self.menuSetting.menuAction())
        self.menubar.addAction(self.menuFile.menuAction())

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(self)

        self.setcenter()

    def retranslateUi(self):
        self.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Login", None, QtGui.QApplication.UnicodeUTF8))
        self.setToolTip(QtGui.QApplication.translate("MainWindow", "Login", None, QtGui.QApplication.UnicodeUTF8))
        self.setStatusTip(QtGui.QApplication.translate("MainWindow", "Login client", None, QtGui.QApplication.UnicodeUTF8))
        self.setWhatsThis(QtGui.QApplication.translate("MainWindow", "ini adalah program untuk memasukkan soal  & jawaban", None, QtGui.QApplication.UnicodeUTF8))

        self.uinfo.setToolTip(QtGui.QApplication.translate("MainWindow", "Login Informasi", None, QtGui.QApplication.UnicodeUTF8))
        self.uinfo.setStatusTip(QtGui.QApplication.translate("MainWindow", "Login Informasi", None, QtGui.QApplication.UnicodeUTF8))
        self.uinfo.setWhatsThis(QtGui.QApplication.translate("MainWindow", "Login Informasi", None, QtGui.QApplication.UnicodeUTF8))
        self.l_head.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:12pt; font-weight:600;\">Evaluasi TIK Client</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        self.l_username.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:10pt; font-weight:600;\">username : </span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        self.l_password.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:10pt; font-weight:600;\">password : </span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        self.l_info.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:italic;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:9pt; font-weight:500;\">masukkan username dan password anda dengan benar !</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        self.l_info2.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:italic;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:9pt; font-weight:500;\">username dan password yang anda masukkan adalah username yang telah terdaftar sebelumnya pada sistem based web, bila terjadi kesalahan terus menerus pada input password dan username, silahkan hub administrator yang bersangkutan </span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        self.j_username.setToolTip(QtGui.QApplication.translate("MainWindow", "masukkan username anda", None, QtGui.QApplication.UnicodeUTF8))
        self.j_username.setStatusTip(QtGui.QApplication.translate("MainWindow", "masukkan username anda", None, QtGui.QApplication.UnicodeUTF8))
        self.j_username.setWhatsThis(QtGui.QApplication.translate("MainWindow", "masukkan username anda", None, QtGui.QApplication.UnicodeUTF8))
        self.j_password.setToolTip(QtGui.QApplication.translate("MainWindow", "masukkan password anda", None, QtGui.QApplication.UnicodeUTF8))
        self.j_password.setStatusTip(QtGui.QApplication.translate("MainWindow", "masukkan password anda", None, QtGui.QApplication.UnicodeUTF8))
        self.j_password.setWhatsThis(QtGui.QApplication.translate("MainWindow", "masukkan password anda", None, QtGui.QApplication.UnicodeUTF8))

        self.login_bt.setToolTip(QtGui.QApplication.translate("MainWindow", "login", None, QtGui.QApplication.UnicodeUTF8))
        self.login_bt.setStatusTip(QtGui.QApplication.translate("MainWindow", "login", None, QtGui.QApplication.UnicodeUTF8))
        self.login_bt.setWhatsThis(QtGui.QApplication.translate("MainWindow", "login", None, QtGui.QApplication.UnicodeUTF8))
        self.login_bt.setText(QtGui.QApplication.translate("MainWindow", "login", None, QtGui.QApplication.UnicodeUTF8))
        
        self.cancel_bt.setToolTip(QtGui.QApplication.translate("MainWindow", "cancel", None, QtGui.QApplication.UnicodeUTF8))
        self.cancel_bt.setStatusTip(QtGui.QApplication.translate("MainWindow", "cancel", None, QtGui.QApplication.UnicodeUTF8))
        self.cancel_bt.setWhatsThis(QtGui.QApplication.translate("MainWindow", "cancel", None, QtGui.QApplication.UnicodeUTF8))
        self.cancel_bt.setText(QtGui.QApplication.translate("MainWindow", "cancel", None, QtGui.QApplication.UnicodeUTF8))

        self.reset_bt.setToolTip(QtGui.QApplication.translate("MainWindow", "reset", None, QtGui.QApplication.UnicodeUTF8))
        self.reset_bt.setStatusTip(QtGui.QApplication.translate("MainWindow", "reset", None, QtGui.QApplication.UnicodeUTF8))
        self.reset_bt.setWhatsThis(QtGui.QApplication.translate("MainWindow", "reset", None, QtGui.QApplication.UnicodeUTF8))
        self.reset_bt.setText(QtGui.QApplication.translate("MainWindow", "reset", None, QtGui.QApplication.UnicodeUTF8))
        
        self.menuAbout.setTitle(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))
        self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8))
        self.menuSetting.setTitle(QtGui.QApplication.translate("MainWindow", "Setting", None, QtGui.QApplication.UnicodeUTF8))
        self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAuthor.setText(QtGui.QApplication.translate("MainWindow", "Author", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSetting.setText(QtGui.QApplication.translate("MainWindow", "Setting", None, QtGui.QApplication.UnicodeUTF8))
        self.actionLihat_semua_soal.setText(QtGui.QApplication.translate("MainWindow", "Lihat semua soal", None, QtGui.QApplication.UnicodeUTF8))
        self.actionClose.setText(QtGui.QApplication.translate("MainWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
        
        self.j_username.connect(self.j_username, QtCore.SIGNAL("valueChanged()"), self.form_return)
        self.j_password.connect(self.j_password, QtCore.SIGNAL("valueChanged()"), self.form_return)

    def setcenter(self):
        screen = QtGui.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - self.width())/2, (screen.height() - self.height())/6)

    def inputdata(self):
       # mylib = library.l_time
        settime = library.l_time()
        datatime = settime.gettime()
        #temp_login = library.temp_ver(1,str(self.j_username.text()), str(self.j_password.text()),"1", str(datatime),'','',self)
        cek_pledge = model.m_login(self)
        temp_login = library.temp_ver('','','','','','','',self)
        maxid = temp_login.getmax()
        if maxid == None:
            maxid = 1
            
        #print "MAXID = ", maxid
        try:
            if cek_pledge.getpledge(str(self.j_username.text()),str(self.j_password.text()),'tpengguna',['hak','status'])[0] == ('guru','active'):
                if (temp_login.insertdatalast(maxid, str(self.j_username.text()), str(self.j_password.text()),"1", "guru","guru", str(datatime)) == True):
                    self.l_info.setText("Proses login berhasil !")
                    self.l_info2.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:italic;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:9pt; font-weight:500;\">username dan password yang anda masukkan adalah username yang telah terdaftar sebelumnya pada sistem based web, bila terjadi kesalahan terus menerus pada input password dan username, silahkan hub administrator yang bersangkutan </span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
                    self.img_info = QtGui.QImage(self.mypath + 'Notice2.png')
                    self.l_image_info.setPixmap(QtGui.QPixmap.fromImage(self.img_info))
                    self.form_input_clear()
                    self.login_bt.hide()
                    self.reset_bt.hide()
                    self.cancel_bt.show()
                    for i in range(0, 5):
                        self.progressbar.setValue(i*30)
                        time.sleep(1)
                    self.win_soal()
                else:
                    self.l_info.setText("Proses login gagal !")
                    self.img_info = QtGui.QImage(self.mypath + 'Error2.png')
                    self.l_image_info.setPixmap(QtGui.QPixmap.fromImage(self.img_info))
                    self.form_input_clear()
                    self.login_bt.show()
                    self.reset_bt.show()
                    self.cancel_bt.hide()
                    self.win_error(temp_login.insertdatalast(maxid, str(self.j_username.text()), str(self.j_password.text()),"1", "guru","guru", str(datatime)))
            elif cek_pledge.getpledge(str(self.j_username.text()),str(self.j_password.text()),'tpengguna',['hak','status'])[0] == ('operator','active'):
                self.win_error(('info','you is operator, this still develop ! \n'))
                self.l_info.setText("Anda adalah Operator !")
                self.img_info = QtGui.QImage(self.mypath + 'Info2.png')
                self.l_image_info.setPixmap(QtGui.QPixmap.fromImage(self.img_info))
                self.form_input_clear()
            else:
                try:
                    self.win_error(('warning','Anda tidak mempunyai akses/izin untuk system ini ! \nSystem ini hanya bisa diakses oleh guru\nDAN\nHak anda adalah ' + str(cek_pledge.getpledge(str(self.j_username.text()),str(self.j_password.text()),'tpengguna',['hak','status'])[0][0])))
                    self.form_input_clear()
                except:
                    data_e = traceback.format_exc()
                    self.win_error(('warning','Anda tidak mempunyai akses/izin untuk system ini ! \n' +'-'*51+'System ini hanya bisa diakses oleh guru'), str(data_e) )
        except:
            data_e = traceback.format_exc()
            datae = str(sys.exc_info()).split(",")[1]
            self.l_info.setText("Proses login gagal !")
            self.l_info2.setText("Program Error ! , terjadi kesalahan pada program, silakan hub administrator !")
            self.img_info = QtGui.QImage(self.mypath + 'Error2.png')
            self.img_info2 = QtGui.QImage(self.mypath + 'Warning2.png')
            self.l_image_info.setPixmap(QtGui.QPixmap.fromImage(self.img_info))
            self.l_image_info2.setPixmap(QtGui.QPixmap.fromImage(self.img_info2))
            self.form_input_clear()
            self.login_bt.show()
            self.reset_bt.show()
            self.cancel_bt.hide()
            if "TypeError" in datae:
                self.win_error(('error','Script Program Error ! '), str(data_e))
            else:
                self.win_error(('warning','Anda tidak mempunyai akses/izin untuk system ini ! '), str(data_e))
            self.form_input_clear()
            #print "ERROR = ", str(data_e)
        
        
    def closeEvent(self, event):
        reply = QtGui.QMessageBox.question(self, 'Message',
            "Apakah anda ingin keluar ?", QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)

        if reply == QtGui.QMessageBox.Yes:
            temp_login = library.temp_ver('','','','','','','',self)
            temp_login.logout()
            event.accept()
        else:
            event.ignore()

    
    def win_error(self, data, addinfo=None):
        print "data = ",data
        error_win = error.elogin(data[0],data[1],self, addinfo)
        #win_about.setData("Just me and todut kevin raja unying and pesek")
        #win_about.setInfo("error")
        error_win.show()
        del(error_win)
        
    def win_soal(self):      
        soal_win = view.vsoal(self)
        soal_win.show()
        self.hide()
        #del(soal_win)
        """
        app = QtGui.QApplication(sys.argv)
        myapp = show_soal()
        myapp.show()
        """
        
    def win_conf(self):
        conf_win = view.Config_Form(self)
        conf_win.show()
        
    def form_input_clear(self):
        self.j_password.clear()
        self.j_username.clear() 
        self.progressbar.setValue(0)
        
    def form_return(self):
        self.l_info.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:italic;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:9pt; font-weight:500;\">masukkan username dan password anda dengan benar !</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        self.l_info2.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:italic;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:9pt; font-weight:500;\">username dan password yang anda masukkan adalah username yang telah terdaftar sebelumnya pada sistem based web, bila terjadi kesalahan terus menerus pada input password dan username, silahkan hub administrator yang bersangkutan </span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
        
    def quit(self):
        self.close()
        
    def keyPressEvent(self, event):
        if event.key() == QtCore.Qt.Key_Return:
            self.inputdata()
        
"""        
def main():
    app = QtGui.QApplication(sys.argv)
    myapp = MainWindows()
    myapp.show()
    app.exec_()
    
#if __name__ == '__main__':
    #main()
    #sys.exit(app.exec_())
"""